#ifndef CTRL_ADD_NEW_PACKAGE_CTRL_CMD_HPP
#define CTRL_ADD_NEW_PACKAGE_CTRL_CMD_HPP

#include "Ctrl/ControlCommand.hpp"

namespace Model { class Package; }

namespace Ctrl
{

/// @ingroup Ctrl
/// @brief It adds a new package to an existing one.
/// 
/// It holds a reference to the parent package and to the new package.
/// <br>
///	See @ref ControlCommands "Control Commands"
class CTRL_API AddNewPackageCtrlCmd: public ControlCommand
{
public:
	/// @brief It initializes the command.
	/// @param ctrlCenter the control center providing the information about the signals to be fired and the storages 
	///		involved in this modification of the model.
	/// @param pParentPackage the parent package to add the new package to.
	/// @param pNewPackage the child package to be added.
	AddNewPackageCtrlCmd( ControlCenter& ctrlCenter, Model::Package* pParentPackage, Model::Package* pNewPackage);

	/// @brief It adds the new package and emits the signal, announcing the listeners that the new package is added. It 
	///		also adds a command to the package storage.
	virtual void execute();

	/// @brief It removes the new package from the parent and emits the signal, announcing the listeners that the new 
	///		package was removed. It also adds a storage command to the package storage.
	virtual void undo();

private:
	Model::Package* pParentPackage_;
	Model::Package* pNewPackage_;
};

} // namespace Ctrl

#endif // CTRL_ADD_NEW_PACKAGE_CTRL_CMD_HPP
